<?php

/**
 * Kupac form base class.
 *
 * @package    marketing
 * @subpackage form
 * @author     Your name here
 */
class BaseKupacForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'korisnicko_ime' => new sfWidgetFormInput(),
      'lozinka'        => new sfWidgetFormInput(),
      'ime'            => new sfWidgetFormInput(),
      'adresa'         => new sfWidgetFormInput(),
      'racun'          => new sfWidgetFormInput(),
      'telefon'        => new sfWidgetFormInput(),
      'email'          => new sfWidgetFormInput(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
      'deleted_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'Kupac', 'column' => 'id', 'required' => false)),
      'korisnicko_ime' => new sfValidatorString(array('max_length' => 15)),
      'lozinka'        => new sfValidatorString(array('max_length' => 15)),
      'ime'            => new sfValidatorString(array('max_length' => 15)),
      'adresa'         => new sfValidatorString(array('max_length' => 45)),
      'racun'          => new sfValidatorString(array('max_length' => 45)),
      'telefon'        => new sfValidatorString(array('max_length' => 45)),
      'email'          => new sfValidatorString(array('max_length' => 45)),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
      'deleted_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('kupac[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Kupac';
  }


}
